//import java.io.File
//
//import Main.{Node, getSampleGroup}
//import Tool.parent
//import com.madhukaraphatak.sizeof.SizeEstimator
//import org.apache.commons.io.FileUtils
//import org.apache.commons.lang3.StringUtils
//
//import scala.collection.mutable
//import scala.collection.mutable.ArrayBuffer
//import scala.concurrent.Future
//import scala.concurrent.ExecutionContext.Implicits.global
//
//
///**
//  * Created by yz on 2019/1/24
//  */
//object Test {
//
//  def main(args: Array[String]): Unit = {
//    val startTime = System.currentTimeMillis()
//    val parent = new File("E:\\rice90k_data_deal\\test")
//    mergeF4File
//
//
//    Utils.logTime(startTime)
//
//
//  }
//
//  def mergeF4File = {
//    val startTime = System.currentTimeMillis()
//    val file = new File(parent, "Kb_5K_raw_Gt.hmp.txt.add_90k_name.hmp.txt")
//    val f4File = new File(parent, "hs.txt")
//    val f4Lines1 = Utils.txt2Lines(f4File)
//    val f4Headers = f4Lines1.head.split("\t")
//    val f4Lines = f4Lines1.map { line =>
//      val columns = line.split("\t")
//      columns.padTo(f4Headers.size, "NN").map { x =>
//        if (StringUtils.isBlank(x)) "NN" else x
//      }.mkString("\t")
//    }
//    val lines = Utils.txt2Lines(file)
//    val f4ColumnLines = Utils.lines2columns(f4Lines)
//    Utils.logTime(startTime)
//    Utils.logTime(startTime)
//    val newLines = lines.zipWithIndex.map { case (line, i) =>
//      val columns = line.split("\t").toBuffer
//      if (i % 5000 == 0) println(i)
//      val newColumns = columns.take(3) ++= f4ColumnLines(i).drop(11) ++= columns.drop(3)
//      newColumns.mkString("\t")
//    }
//    Utils.lines2File(new File(parent, "Kb_5K_raw_Gt.hmp.txt.add_90k_name.hmp_hs.txt"), newLines)
//    Utils.lines2File(new File(parent, "hs.test.txt"), f4Lines)
//  }
//
//  def countOut = {
//    val parent = new File("E:\\rice90k_data_deal")
//    val file = new File(parent, "out1.txt")
//    val lines = Utils.txt2Lines(file)
//    val newlines = ArrayBuffer(s"Num\t${lines.head}") ++ lines.drop(1).map { line =>
//      val columns = line.split("\t")
//      val size = columns.drop(6).count(x => x == "1")
//      s"$size\t$line"
//    }
//    Utils.lines2File(new File(parent, "out_count.txt"), newlines)
//  }
//
//  def productOut1 = {
//    val parent = new File("E:\\rice90k_data_deal")
//    val file = new File(parent, "out.txt")
//    val lines = Utils.txt2Lines(file)
//    val newlines = lines.take(1) ++ lines.drop(1).sortBy { line =>
//      val columns = line.split("\t")
//      (columns(0).toInt, columns(1).toInt)
//    }
//    Utils.lines2File(new File(parent, "out1.txt"), newlines)
//  }
//
//}
